package com.gaofans.nrpc.common.compress;

import io.netty.buffer.ByteBuf;

import java.io.IOException;
import java.io.OutputStream;

/**
 * 数据压缩器
 * @author GaoFans
 */
public interface Compressor {

    /**
     * 编码类型
     * @return
     */
    byte getMessageEncoding();

    /**
     * 压缩
     * @param out
     * @return
     * @throws IOException
     */
    byte[] compress(byte[] out) throws IOException;
}
